<include file="Public/header"/>

<div id="app">
    <!-- sidebar -->
    <include file="Public/left"/>
    <!-- / sidebar -->
    <div class="app-content">
        <!-- start: TOP NAVBAR -->
        <include file="Public/headernav"/>
        <!-- end: TOP NAVBAR -->
        <div class="main-content">
            <div class="wrap-content container" id="container">
                <!-- start: PAGE TITLE -->
                <section id="page-title">
                    <div class="row">
                        <div class="col-sm-8">
                            <!-- <h1 class="mainTitle">会员列表</h1> -->
                            <span class="mainDescription">订单管理页面 </span>
                        </div>
                        <!-- <ol class="breadcrumb">
                            <li>
                                <span>Pages</span>
                            </li>
                            <li class="active">
                                <span>Blank Page</span>
                            </li>
                        </ol> -->
                    </div>
                </section>
                <!-- end: PAGE TITLE -->
                <!-- start: YOUR CONTENT HERE -->
                <style type="text/css">
                    .class_hidden {
                        display: none;
                    }

                    .panel-body {
                        padding: 5px;
                    }

                    .panel-heading {
                        padding: 5px;
                        min-height: 25px;
                    }
                </style>
                <div class="row">
                    <div class="col-lg-12 col-md-12 margin-top-20">
                        <div class="panel panel-white">
                            <div class="panel-heading">
                                <h5 class="panel-title">筛选</h5>
                            </div>
                            <form role="form" class="form-inline">
                                <div class="panel-body">


                                    <div class="form-group">
                                        <label class="sr-only">
                                            收货人
                                        </label>

                                        <input type="text" name="consignee" value="{$_GET.consignee}" id="consignee"
                                               placeholder="收货人" class="form-control">
                                    </div>
                                    <div class="form-group">
                                        <label class="sr-only">
                                            订单号
                                        </label>

                                        <input type="text" name="order_sn" value="{$_GET.order_sn}" id="order_sn"
                                               placeholder="订单号" class="form-control">
                                    </div>
                                    <div class="form-group">
                                        <label class="sr-only">
                                            电话
                                        </label>
                                        <input type="text" name="mobile" value="{$_GET.mobile}" id="mobile"
                                               placeholder="电话" class="form-control">
                                    </div>
                                    <div class="form-group">
                                        <label class="sr-only">
                                            订单类型
                                        </label>
                                        <select class="form-control" id="order_state" name="order_state">
                                            <option value="all"
                                            <if condition="$_GET['order_state'] =='all'">selected</if>
                                            >全部类型</option>
                                            <option value="0"
                                            <if condition="$_GET['order_state'] =='0'">selected</if>
                                            >待付款</option>

                                            <option value="2"
                                            <if condition="$_GET['order_state'] =='2'">selected</if>
                                            >已付款</option>

                                            <option value="1"
                                            <if condition="$_GET['order_state'] =='1'">selected</if>
                                            >待确认</option>

                                            <option value="7"
                                            <if condition="$_GET['order_state'] =='7'">selected</if>
                                            >备货中</option>

                                            <option value="6"
                                            <if condition="$_GET['order_state'] =='6'">selected</if>
                                            >已配送</option>

                                            <option value="3"
                                            <if condition="$_GET['order_state'] =='3'">selected</if>
                                            >已完成</option>
                                            <option value="8"
                                            <if condition="$_GET['order_state'] =='8'">selected</if>
                                            >无效</option>
                                            <!-- <option value="4"
                                            <if condition="$_GET['order_state'] =='4'">selected</if>
                                            >已退货</option> -->
                                            <option value="5"
                                            <if condition="$_GET['order_state'] =='5'">selected</if>
                                            >已取消</option>
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <label class="sr-only">
                                            可统计
                                        </label>
                                        <a  href="javascript:void(0);" class="form-control <if condition="$_GET['statistics'] =='1'">btn-primary</if> " id="stat_but"  > 可统计</a>
                                        <input type="hidden" name="statistics" id="statistics"  value="{$_GET['statistics']}"/>
                                    </div>
                                    <div class="form-group">
                                        <label class="sr-only">
                                            订单类型
                                        </label>
                                        <select class="form-control" name="is_upgrade" style="display: none">
                                            <option value="">订单类型</option>
                                            <option value="0"
                                            <if condition="$_GET['is_upgrade'] neq '' and $_GET['is_upgrade'] eq 0">selected</if>
                                            >普通订单</option>
                                            <option value="1"
                                            <if condition="$_GET['is_upgrade'] eq 1">selected</if>
                                            >会员升级订单</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="panel-body">
                                    下单时间：
                                    <div class="form-group">
                                        <label for="type" class="sr-only">
                                            下单时间
                                        </label>

                                        <p class="input-group input-append datepicker date">
                                            <input type="text" class="form-control" name="start_time"
                                                   value="{$_GET['start_time']}" placeholder="下单时间"/>
			<span class="input-group-btn">
				<button type="button" class="btn btn-default">
                    <i class="glyphicon glyphicon-calendar"></i>
                </button> </span>
                                        </p>
                                        --
                                        <p class="input-group input-append datepicker date">
                                            <input type="text" class="form-control" name="end_time"
                                                   value="{$_GET['end_time']}" placeholder="下单时间"/>
			<span class="input-group-btn">
				<button type="button" class="btn btn-default">
                    <i class="glyphicon glyphicon-calendar"></i>
                </button> </span>
                                        </p>

                                    </div>
                                    <br/>
                                    支付时间：
                                    <div class="form-group">
                                        <label for="type" class="sr-only">
                                            支付时间
                                        </label>

                                        <p class="input-group input-append datepicker date">
                                            <input type="text" class="form-control" name="pay_start_time"
                                                   value="{$_GET['pay_start_time']}" placeholder="支付时间"/>
			<span class="input-group-btn">
				<button type="button" class="btn btn-default">
                    <i class="glyphicon glyphicon-calendar"></i>
                </button> </span>
                                        </p>
                                        --
                                        <p class="input-group input-append datepicker date">
                                            <input type="text" class="form-control" name="pay_end_time"
                                                   value="{$_GET['pay_end_time']}" placeholder="支付时间"/>
			<span class="input-group-btn">
				<button type="button" class="btn btn-default">
                    <i class="glyphicon glyphicon-calendar"></i>
                </button> </span>
                                        </p>

                                    </div>


                                    <div class="form-group  " style="margin-top: -10px;">
                                        <button class="btn btn-primary" type="submit">
                                            提交
                                        </button>
                                    </div>


                                </div>


                            </form>
                        </div>
                    </div>
                </div>


                <table class="table table-hover" id="sample-table-1">
                    <thead>
                    <tr>
                        <th class="center">#</th>
                        <th>订单编号</th>
                        <th>订单金额</th>
                        <th class="hidden-xs">收货人</th>
                        <th>手机</th>
                        <th>收货地址</th>
                        <th>下单时间</th>
                        <th>支付时间</th>
                        <th>状态</th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
                    <volist name="list['list']" id='vo' key='key'>
                        <tr>
                            <td class="center"></td>
                            <td>
                                {$vo.order_sn}
                            </td>
                            <td>
                                {$vo['order_amount']+$vo['shipping_fee']}【
                                <if condition="$vo['surplus'] neq 0">
                                    余额支付：￥{$vo['surplus']}
                                </if>
                                <if condition="$vo['integral'] neq 0">
                                    积分支付：￥{$vo['integral_money']}({$vo['integral']}积分)
                                </if>
                                <if condition="$vo['pay_name'] eq 'wxpay'">
                                    微信支付：￥{$vo['order_amount']+$vo['shipping_fee'] - $vo['surplus'] - $vo['integral_money']}
                                </if>
                                】
                            </td>
                            <td class="hidden-xs">{$vo.consignee}</td>
                            <td>{$vo.mobile}</td>
                            <td>{$vo.address}</td>
                            <td>{$vo.add_time|date="Y-m-d",###}</td>
                            <td>{$vo.pay_time|date="Y-m-d H:i:s",###}</td>
                            <td id="name_{$vo.order_id}">{$vo['show_order']['name']}</td>
                            <td class="center">
                                <div class="visible-md visible-lg hidden-sm hidden-xs">
							<span id="delete_{$vo.order_id}">
							<if condition="$vo['show_order']['code'] eq 'unconfirmed'">
                                {//待确认}<!-- {:U("Admin/goodsorder/order_exchange",array('id'=>$vo['order_id']))} -->
                                <a href="javascript:void(0);" class="btn btn-transparent btn-xs" tooltip="Edit"
                                   id="unconfirmed_{$vo.order_id}"
                                   tooltip-placement="top" data-toggle="tooltip" data-original-title="确认订单"
                                   onclick="chakan({$vo.order_id})">
                                    <i class="fa fa-check-square"></i></a>

                                <elseif condition="$vo['show_order']['code'] eq 'nondelivery'"/>
                                {//未发货}
                                <a href="javascript:void(0);" class="btn btn-transparent btn-xs" tooltip="Edit"
                                   id="nondelivery_{$vo.order_id}"
                                   tooltip-placement="top" data-toggle="tooltip" data-original-title="配送"
                                   value="{$vo.shipping_status}" onclick="chakan({$vo.order_id})">
                                    <i class="fa fa-truck"></i></a>

                            </if>
							</span>
							<span>	
                           	<a href="{:U('Admin/goodsorder/Order_detail',array('id'=>$vo['order_id']))}"
                               class="btn btn-transparent btn-xs nondelivery"
                               tooltip="Edit" tooltip-placement="top" data-toggle="tooltip" data-original-title="查看"><i
                                    class="fa fa-file-text-o"></i>
                            </a>
                             </span>
                                </div>
                            </td>
                        </tr>

                    </volist>


                    </tbody>
                </table>


                <div class="col-md-12 pages" align="center">{$list['page']|default='暂无数据'}</div>


                <!-- end: YOUR CONTENT HERE -->
            </div>
        </div>
    </div>
    <!--  FOOTER and SETTINGS -->

    <include file="Public/footer"/>
    <!-- end: FOOTER -->
    <!-- start: OFF-SIDEBAR -->

    <!-- end: OFF-SIDEBAR -->

</div>
<!-- start: MAIN JAVASCRIPTS -->

<include file="Public/javascript"/>
<include file="Public/javascript_datepicker"/>
<script src="__PUBLIC__/bootstrap/vendor/artDialog/artDialog.source.js?skin=default"></script>
<script src="__PUBLIC__/bootstrap/vendor/artDialog/plugins/iframeTools.source.js"></script>
<script type="text/javascript">
    function chakan(order_id) {
        art.dialog.open("{:U('Admin/goodsorder/order_exchange')}?id=" + order_id, {
                    title: '确认订单/配送',
                    lock: true,
                    width: '300px',
                    height: '250px',
                    opacity: 0.5
                }
        );
    }
    //							            lock:false,
    //							            title: '确认订单',
    //                                        width: '400px',
    //                                        height: '300px',
    //							 			width:300,height:200,yesText:'关闭',
    //							 			opacity: 0.87,
    //							            fixed:true
</script>
<script>
    //btn-primary

    $('#stat_but').click(function () {
        var statistics = $('#statistics').val();

            if(statistics == 1){
                $('#statistics').val('0');
                $(this).removeClass('btn-primary');
            }else {
                $('#statistics').val('1');
                $(this).addClass('btn-primary');
            }
    });
</script>

</body>
</html>
